<?php if(!defined('HOST'))die('not access');?>
<script >
$(document).ready(function(){
	
	
	var c={
		init:function(){
			var o = get('btnss{rand}');
			o.value='加载中...';
			js.ajax(js.getajaxurl('gettotal','{mode}','{dir}'),false,function(ret){
				if(ret.success){
					$('#stotal{rand}').html(ret.data.smstotal);
				}else{
					js.msg('msg', ret.msg);
				}
				o.value='刷新';
			},'get,json');
		},
		ceshi:function(){
			js.prompt('测试发短信','输入手机号码(测试成功会扣除一条短信)',function(lx,txt){
				if(lx=='yes'&&txt)c.sheniokx(txt)
			});
		},
		sheniokx:function(sj){
			js.msg('wait','发送中...');
			js.ajax(js.getajaxurl('testsend','{mode}','{dir}'),{mobile:sj},function(ret){
				if(ret.success){
					js.msg('success','测试发送成功');
					c.init();
				}else{
					js.msg('msg', ret.msg);
				}
			},'get,json');
		}
	};
	js.initbtn(c);
	c.init();
});
</script>

<div align="left">
<div  style="padding:10px;">
		
	<table cellspacing="0" width="550" border="0" cellpadding="0">
	
	<tr>
			<td  colspan="2"><div class="inputtitle">基本信息
			</div></td>
		</tr>

	<tr>
		<td  align="right" width="180">短信剩余条数：</td>
		<td class="tdinput"><span id="stotal{rand}">0</span>条，<a class="btn btn-success btn-xs" href="<?=URLY?>user_index_sms_a.html" target="_blank">去充值</a></td>
	</tr>
	
	<tr>
		<td  align="right" ></td>
		<td class="tdinput">
		<input type="button" click="init" id="btnss{rand}" value="刷新" class="btn btn-default">&nbsp; &nbsp;
		<input type="button" click="ceshi" id="test{rand}" value="测试发送" class="btn btn-default">&nbsp;&nbsp;
		</td>
	</tr>
	
	</table>
	<div class="tishi">使用短信前，必须到【系统→系统工具→系统设置】下设置[官网key]。<a href="<?=URLY?>view_sms.html" target="_blank">[使用帮助]</a></div>
</div>
</div>
